package service

import "week04/internal/data"

type UserInfo struct {
	Id   string
	Name string
}

// 转换data层数据
func TransFromUserData(userInfo *data.UserInfo) *UserInfo {
	return &UserInfo{
		Id:   userInfo.Id,
		Name: userInfo.Name,
	}
}

func QueryUser(id string) *UserInfo {
	dataUserInfo := data.QueryUserById(id)
	return TransFromUserData(dataUserInfo)
}
